Index: admin.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/wiki/admin.php,v
retrieving revision 1.23
diff -u -r1.23 admin.php
--- admin.php 4 Oct 2006 10:11:15 -0000 1.23
+++ admin.php 20 Oct 2006 10:38:08 -0000
@@ -95,27 +95,31 @@
$strwiki = get_string("modulename", "wiki");
/// Validate Form
- if ($form = data_submitted()) {
- switch($action) {
+
+ if ($fromform = data_submitted()) {
+
+ switch($action) {
case "revertpages":
- if(!$form->deleteversions || 0 > $form->deleteversions || $form->deleteversions > 1000) {
+
+ if(!$fromform->deleteversions || 0 > $fromform->deleteversions || $fromform->deleteversions > 1000) {
$focus="form.deleteversions";
$err->deleteversions=get_string("deleteversionserror","wiki");
}
- if(!$form->changesfield || 0 > $form->changesfield || $form->changesfield > 100000) {
+ if(!$fromform->changesfield || 0 > $fromform->changesfield || $fromform->changesfield > 100000) {
$focus="form.changesfield";
$err->changesfield=get_string("changesfielderror","wiki");
}
- if($form->authorfieldpattern=="") {
+ if($fromform->authorfieldpattern=="") {
$focus="form.authorfieldpattern";
$err->authorfieldpattern=get_string("authorfieldpatternerror","wiki");
}
+
break;
default: break;
}
}
- print_header_simple("$wiki_entry->pagename", "",
+ print_header_simple("$wiki_entry->pagename", "",
"id\">$strwikis -> ".format_string($wiki->name,true)." ->".
get_string("administration","wiki"),
$focus, "", true, update_module_button($cm->id, $course->id, $strwiki),
@@ -128,6 +132,7 @@
if ($form = data_submitted()) {
/// Moodle Log
/// Get additional info
+
$addloginfo="";
switch($action) {
case "removepages":
@@ -148,6 +153,7 @@
}
add_to_log($course->id, "wiki", $action, "admin.php?action=$action&userid=$userid&groupid=$groupid&id=$id", $wiki->name.($addloginfo?": ".$addloginfo:""));
$link="admin.php?action=$action".($userid?"&userid=".$userid:"").($groupid?"&groupid=".$groupid:"")."&id=$id&page=$page";
+
switch($action) {
case "removepages":
if($form->proceed) {
@@ -198,8 +204,10 @@
break;
case "revertpages":
if(!$err) {
- if(!$confirm) {
- $confirm="&confirm[changesfield]=".urlencode($form->changesfield).
+
+ if(!$confirm) {
+
+ $confirm="&confirm[changesfield]=".urlencode($form->changesfield).
"&confirm[authorfieldpattern]=".urlencode($form->authorfieldpattern).
"&confirm[howtooperate]=".urlencode($form->howtooperate).
"&confirm[deleteversions]=".urlencode($form->deleteversions);
@@ -210,7 +218,8 @@
print_footer($course);
exit;
} else {
- $err->remark=get_string("nochangestorevert","wiki");
+ $err->remark=get_string("nochangestorevert","wiki");
+
}
}
}
@@ -221,8 +230,10 @@
}
/// Actions which need a confirmation. If confirmed, do the action
+
$redirect="view.php?".($groupid?"&groupid=".$groupid:"").($userid?"&userid=".$userid:"")."&id=$id&page=$page";
if($confirm && !$err) {
+
switch($action) {
case "removepages":
$ret=wiki_admin_remove(split(" ",$confirm), $course, $wiki, $userid, $groupid);
@@ -332,14 +343,17 @@
echo '';
}
- // The wiki Contents
- print_simple_box_start( 'center', '100%', '', '20');
// Do the Action
# "setpageflags", "removepages", "strippages", "checklinks", "revertpages"
print_heading_with_help(get_string($action,"wiki"), $action, "wiki");
- include $action.".html";
- print_simple_box_end();
-
+ if ($action='revertpages'){
+ include 'revertpages_form.php';
+ $mform = new wikki_revertpages_form('admin.php',compact('userid','groupid','action','cm','id','wikipage','err','form'));
+ $mform->display();
+ }else {
+ include $action.".html";
+ }
+
/// Finish the page
print_footer($course);
exit;